#include <stdio.h>

#define NUM_COLS 24
#define NUM_ROWS 7

void find_largest(const int *a, int n, int *largest);

int main(void)
{
    int temperatures[NUM_ROWS][NUM_COLS], temp = 1000;

    for (int i = 0; i < NUM_ROWS; i++)
    {
        for (int j = 0; j < NUM_COLS; j++)
            temperatures[i][j] = temp--;
    }


    int largest;
    int *q;

    for (int i = 0; i < NUM_ROWS; i++)
    {
        find_largest(q = temperatures[i], NUM_COLS, &largest);
        printf("In %d day %d degree \n", i + 1, largest);
    }

    for (int i = 0; i < NUM_ROWS; i++)
    {
        for (int j = 0; j < NUM_COLS; j++)
            printf("%d ", temperatures[i][j]);
        printf("\n");
    }


    return 0;
}


void find_largest(const int *a, int n, int *largest)
{
    *largest = *a;

    for (int i = 1; i < n; i++)
    {
        if (*(a + i) > *largest)
            *largest = *(a + i);
    }
}
